package ManagerSystem;

import java.util.Scanner;

import tjut.db.DBDriverFactory;

/**
 * 添加学生信息
 * @author ChrisL
 *
 */
public class AddStuInfo {

	public void Info(){
		System.out.println("***********新建学生信息***********");
		Scanner input=new Scanner(System.in);
		System.out.println("请输入学生ID:");
		String Stuid=input.next();
		System.out.println("请输入学生姓名:");
		String Stuname=input.next();
		System.out.println("请输入学生性别:");
		String Stusex=input.next();
		System.out.println("请输入学生年龄:");
		String Stuage=input.next();
		System.out.println("请输入学生电话:");
		String Stuphone=input.next();
		System.out.println("请输入学生地址:");
		String Stuadd=input.next();
		System.out.println("请输入学生密码:");
		String Stupsw=input.next();
		
		String strSQL = "insert into MANAGERSYS (STU_ID ,STU_NAME,STU_SEX,STU_AGE,STU_PHONE,STU_ADDRESS,STU_PSW) values(?,?,?,?,?,?,?)";
		int i =  DBDriverFactory.getDBDriverInstance().update(strSQL,new Object[]
				{Stuid,Stuname,Stusex,Stuage,Stuphone,Stuadd,Stupsw});
		System.out.println(i>0?"新建成功":"新建失败");
	}
}
